package com.tiger.cloud.service.rejection;

import com.tiger.cloud.model.rejection.Rejection;
import com.tiger.cloud.model.rejection.UserRejection;
import com.tiger.cloud.dao.rejection.RejectionDao;
import com.tiger.cloud.dao.rejection.UserRejectionDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tiger.cloud.common.mybatis.TigerBaseService;
import com.tiger.cloud.common.mybatis.MybatisTigerDao;

/**
 * 接单/甩单
 */
@Service("userRejectionService")
public class UserRejectionService extends TigerBaseService<UserRejection> implements IUserRejectionService{
    
    @Autowired
	private UserRejectionDao userRejectionDao;
    @Autowired
	private RejectionDao rejectionDao;

	@Override
	public MybatisTigerDao<UserRejection> getEntityDao() {
		return userRejectionDao;
	}

	@Override
	public Boolean insertRejection(UserRejection userRejection) {
		Rejection rejection=new Rejection();
		rejection.setViewCount(1);
		rejection.setId(userRejection.getRejectionId());
		if(rejectionDao.updateCount(rejection)>0){
			return userRejectionDao.insert(userRejection) >0;
		}
		return false;
	}
    
}